<template>
	<view>
			<view v-for="(item,index) in datalist" style="margin: 10rpx;">
				<CustomTextView
				:title="item.title"
				:isTop="item.isTop"
				:author="item.author"
				:Comment="item.Comment"
				:time="item.time"
				:images="item.images"
				:mode="item.mode"
				@click="onCustomViewClick(index)">
				<template v-slot:tips>
					<view class="slotcontent" v-if="item.showSearch">
						<text class="ss">搜索:</text>
						<view class="borderbox"><text>国家</text></view>
						<view class="borderbox"><text>法律</text></view>
					</view>
				</template>
				</CustomTextView>
				</view>
	</view>
</template>

<script>
	import data from "../../../data/news.json"
	import CustomTextView from "../../../components/cardViewText.vue"
	export default {
		components:{
			CustomTextView
		},
		mounted() {
		  const da = data.contentList;
		  console.log("组件挂载 " + JSON.stringify(da));
		},
		data() {
			return {
				datalist:[{
					title:"今年前九个月 全国纪检监察机关共接收信访举报314.4万件次",
					isTop:true,
					author:"央视",
					Comment:"75评",
					time:"2025.10.29",
					images:["/static/city1.png"],
					mode:1,
					showSearch: true
				},
				{
					title:"巴西里约警方大规模打击犯罪组织 我领馆发布紧急安全提醒",
					isTop:false,
					author:"央视",
					Comment:"42评",
					time:"2025.10.29",
					images:[""],
					mode:2
				},
				{
					title:"金顶智库|杨烨辉：“十五五”规划建议四大部署方向值得关注",
					isTop:false,
					author:"央广网",
					Comment:"77评",
					time:"2025.10.29",
					images:["/static/city3.jpg"],
					mode:2
				},
				{
					title:"全国人民代表大会常务委员会公告〔十四届〕第十三号",
					isTop:false,
					author:"新京报",
					Comment:"263评",
					time:"2025.10.28",
					images:["/static/city1.png"],
					mode:2
				},
				{
					title:"全国人民代表大会常务委员会关于修改《中华人民共和国网络安全法》的决定",
					isTop:false,
					author:"澎湃新闻",
					Comment:"30评",
					time:"2025.10.29",
					images:[""],
					mode:2
				}]
			}
		},
		// props:{
		// 	title:{
		// 		type:String,
		// 		default:"新闻标题",
		// 		required:true
		// 	},
		// 	isTop:{
		// 		type:Boolean,
		// 		default:false,
		// 		required:true
		// 	},
		// 	author:{
		// 		type:String,
		// 		default:"来源",
		// 		required:true
		// 	},
		// 	Comment:{
		// 		type:Number,
		// 		default:0,
		// 		required:true
		// 	},
		// 	title:{
		// 		type:String,
		// 		default:"2025.10.29",
		// 	}
		// },
		methods: {
			
		}
	}
</script>

<style>
.borderbox{
    border: 1rpx solid #ddd;
    border-radius: 12rpx; /* 圆角更明显 */
    padding: 2rpx 12rpx; /* 上下2rpx，左右12rpx，避免文字拥挤 */
    margin-left: 8rpx; /* 标签之间的间距 */
    background-color: #f5f5f5; /* 浅灰背景，区分于其他文本 */
}
.slotcontent{
    display: flex;
    align-items: center;
    margin: 0 15rpx;
    font-size: 24rpx;
    color: #666; 
}
.ss{
	color: #000000;
}
</style>
